#Include 'Protheus.ch'




#Define CR CHR(13)+CHR(10)

User Function fProd()

Local _cAux := ""
Local _aAreaC5 := GetArea("SC5")
Local _aAreaC6 := GetArea("SC6")

dbSelectArea("SC6")
dbSetOrder(1)

If dbSeek(xFilial("SC6")+SC5->C5_NUM)
	
	_cAux += "Produtos constantes no Pedido: "+CR+CR

	While !SC6->(EoF()) .And. SC6->C6_NUM == SC5->C5_NUM
	
		dbSelectArea("SB1")
		dbSetOrder(1)
		dbSeek(xFilial("SB1")+SC6->C6_PRODUTO)
		
			_cAux += padr(SB1->B1_COD,10) + padr(SB1->B1_DESC,32) + Transform(SC6->C6_VALOR,"@E 999,999,999.99") + CR 
		
		SC6->(dbSkip())	
	
	EndDo

EndIf

Aviso("Pontin Technology",_cAux,{"Ok","Cancelar"},3,"Produtos")

RestArea(_aAreaC5)
RestArea(_aAreaC6)

Return

